// LampCordServerDlg.h : header file
//

#pragma once

#include "../Common/NetChat.h"
#include "../Common/SendData.h"
#define WM_SHOWTASK (WM_USER +1)

// CLampCordServerDlg dialog
class CLampCordServerDlg : public CDialog
{
// Construction
public:
	CLampCordServerDlg(CWnd* pParent = NULL);	// standard constructor

// Dialog Data
	enum { IDD = IDD_LAMPCORDSERVER_DIALOG };

	protected:
	virtual void DoDataExchange(CDataExchange* pDX);	// DDX/DDV support


// Implementation
protected:
	HICON m_hIcon;

	// Generated message map functions
	virtual BOOL OnInitDialog();
	afx_msg void OnSysCommand(UINT nID, LPARAM lParam);
	afx_msg void OnPaint();
	afx_msg HCURSOR OnQueryDragIcon();
	afx_msg void OnBnClickedOk();
	DECLARE_MESSAGE_MAP()

	void Listen(void);
	void Connect(void);
	void OnRecive(const BYTE* pBuffer, size_t nLen);
	void Disconnect(void);
	void SetState(bool bStart);
	void ToTray();
	afx_msg LRESULT OnShowTask(WPARAM wParam,LPARAM lParam);
	void DeleteTray();
	BOOL installHook();
private:
	CNetChatServer m_mySender;
	CNetChatClient m_myListener;

	bool m_bStarted;
protected:
	virtual LRESULT WindowProc(UINT message, WPARAM wParam, LPARAM lParam);
};
